<%-- 
    Document   : RoomStatus
    Created on : Jan 24, 2013, 9:14:37 PM
    Author     : TuanAnh
--%>

<%@page import="edu.fpt.entity.Room"%>
<%@page import="java.util.List"%>
<%@page import="edu.fpt.stub.RoomStub"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="css/modern.css" type="text/css" />  
        <title>Room Status</title>
        <script>
            function isNumberKey(evt)
            {
                var charCode = (evt.which) ? evt.which : event.keyCode
                if (charCode > 31 && charCode < 48 || charCode > 57 || charCode == 46)
                    return false;
                return true;
            }
        </script>
    </head>
    <body style="color: darkred; " bgcolor="#e4e3e3">
        <%
            session = request.getSession();
            String user6 = (String) session.getAttribute("id");
            if (user6 == null) {
                response.sendRedirect("LoginForm.jsp");
            } else {
        %>
        <div>
            <h1 style="color: #4D1124; margin-left: 250px">Management Information</h1>

        </div>
        <div class="progress-bar">
            <div class="bar bg-color-blue" style="width: 33%"></div>
            <div class="bar bg-color-yellow" style="width: 33%"></div>
            <div class="bar bg-color-green" style="width: 34%"></div>
        </div>
        <div style="margin-top: 30px"></div>
        <form name="order" method="post">
            <table class="">
                <thead>
                    <tr style="background-color: #85373b"  >
                        <th style="color: white; text-align: center; width: 140px; font-size: 17px">Room ID</th>
                        <th style="color: white; text-align: center; width: 280px; font-size: 17px">Room Type</th>
                        <th style="color: white; text-align: center; width: 100px; font-size: 17px">Reservation</th>
                        <th style="color: white; text-align: center; width: 250px; font-size: 17px">Received</th>
                    </tr>
                    <%
                        RoomStub stub = new RoomStub();
                        List<Room> list = stub.getRoomType();
                        for (Room ro : list) {
                    %>
                    <tr style="background-color: #dfb7b7">
                        <th style="color: #8e1f1f; text-align: center; width: 140px"><%= ro.getRoomID()%></th>
                        <th style="color: #8e1f1f; text-align: center; width: 280px"><%= ro.getRoomType().getRoomType()%></th>
                        <%
                            if (ro.getReservation() == true) {
                        %>
                        <th style="color: #8e1f1f; text-align: center; width: 100px">True</th>
                        <% } else {%>
                        <th style="color: #8e1f1f; text-align: center; width: 100px">False</th>
                        <% }%>
                        <%
                            if (ro.getReceived() == true) {
                        %>
                        <th style="color: #8e1f1f; text-align: center; width: 100px">True</th>
                        <% } else {%>
                        <th style="color: #8e1f1f; text-align: center; width: 100px">False</th>
                        <% }%>
                    </tr>                     
                    <%
                        }
                    %>
                </thead>
            </table>
            <div style="margin-top: 25px"></div>            

            <div style="margin-left: 350px"><input type="submit" value="Submit" name="submit" style="background-color: #0865c2"/><span><input type="reset" value="Reset" style="background-color: #e3a21a; color: white;"/></span><span><input type="button" value="Go Back" style="background-color: #47bf4e; color: white;" onclick="window.location.href='AdminForm.jsp'"/></span></div>            
        </form>


        <% }%>
    </body>
</html>
